package org.example.springioc;

import org.example.springioc.component.UserComponent;
import org.example.springioc.config.UserConfig;
import org.example.springioc.controller.UserController;
import org.example.springioc.resp.UserReopsitory;
import org.example.springioc.service.UserService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class SpringIocApplication {

    public static void main(String[] args) {
        ApplicationContext context =SpringApplication.run(SpringIocApplication.class, args);
//        UserController bean=context.getBean(UserController.class);
//        bean.say();
//        UserController userController= (UserController) context.getBean("userController");
//        userController.say();
//        UserController userController1= context.getBean("userController",UserController.class);
//        userController1.say();
//        UserService bean = context.getBean(UserService.class);
//        bean.say();
//        UserReopsitory bean = context.getBean(UserReopsitory.class);
//        bean.say();
//        UserComponent bean1 = context.getBean(UserComponent.class);
//        bean1.say();
//        UserConfig bean2 = context.getBean(UserConfig.class);
//        bean2.say();
    }

}
